UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vcP0f0UvIKW8GMwp54o7+UfGJSLF4ZOfnyblU7GmgVs='
WHERE
key_id = '9293616c94dfae016ebed787d4849b3d8813143cfe0515bae8fc641ec13856ac'
AND (
token = 'vcP0f0UvIKW8GMwp54o7+UfGJSLF4ZOfnyblU7GmgVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)