UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xm8PHzGPD5dolTbqjyCdIgQaZG8AXb7Y4C4pF1hImDo='
WHERE
key_id = '4d8feabf75385d7073a6205426ee1b4aadcc61a020f93bd76e071fb4032d3b21'
AND (
token = 'xm8PHzGPD5dolTbqjyCdIgQaZG8AXb7Y4C4pF1hImDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)