UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tY/GW24O1PW5nGhcamlvwXnrXzpMn/AKrGb40umeBo4='
WHERE
key_id = '6b287d9fda3cbe58eb351a783bfd04729c2ce6ba32a3e055045b15c4dd218840'
AND (
token = 'tY/GW24O1PW5nGhcamlvwXnrXzpMn/AKrGb40umeBo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)