UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ifr6jSwdYjvQeBnCQ2mk5t6iDAVE+qAL/wLbzQwelLg='
WHERE
key_id = '5282af79c6bf3c98fd01c527650914c5c14cbe25a7417cf8ca38fc3fb4e17aa9'
AND (
token = 'ifr6jSwdYjvQeBnCQ2mk5t6iDAVE+qAL/wLbzQwelLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)