UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vVv0/SZy5lkiv5ptVR9oXcGnf3DDB4tGW9j7SeqlYv0='
WHERE
key_id = '96dcea5d77b5cbacee07e686b977cb21c6f5c8ebed56da0287af05831e5c72ab'
AND (
token = 'vVv0/SZy5lkiv5ptVR9oXcGnf3DDB4tGW9j7SeqlYv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)