UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fF1SBdeqcxkpBJrhLD17NtVeJtmqlAAkLMnThBTNBkc='
WHERE
key_id = '5f581c856cc89f93bf5a9a0d61b253c6dbcf6bb9f0ffa5023e6825254558da27'
AND (
token = 'fF1SBdeqcxkpBJrhLD17NtVeJtmqlAAkLMnThBTNBkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)