UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iPZKRvNP/ShmU48G4dgWa8zdIs8j9yqWOC6uUtgS3h4='
WHERE
key_id = '08c43c748802de33433770773fcb25c2d1d02239f0ad7c7e9ea51ad27cffc714'
AND (
token = 'iPZKRvNP/ShmU48G4dgWa8zdIs8j9yqWOC6uUtgS3h4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)