UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1n/litrphIpRwhwIhMVbYybn0U6/xgor/4eyP10AqsE='
WHERE
key_id = 'e1544dcd53dd21ef5ab5b08aab088762d61578509994e6d2f9498b3384177259'
AND (
token = '1n/litrphIpRwhwIhMVbYybn0U6/xgor/4eyP10AqsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)