UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1oTqDyboffoTqmY9XcZ1/LWkhUGktpsxm/jKP/ukmi4='
WHERE
key_id = 'f38ddf213d3d2e51c3446771d908ed16733f1b8d7cc9e8c9f02efcc085ca0bc3'
AND (
token = '1oTqDyboffoTqmY9XcZ1/LWkhUGktpsxm/jKP/ukmi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)