UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J/LOraSCZ6quSIjARURJ68Ra2PydgJVR8ZNnBQi6CcA='
WHERE
key_id = 'e1e7a1782ca3d730d8f58f7e817472a480918f85b3e586cd4f0dc9d6e80e586f'
AND (
token = 'J/LOraSCZ6quSIjARURJ68Ra2PydgJVR8ZNnBQi6CcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)