UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hdrmQWHogIAIYFpwbUx/RBD8gLvqNwO2v0kwnIHz3U4='
WHERE
key_id = 'b64ed3d3954acf902cca81cc45e9b92ab8f4229382efb2d4514a6e3f3e3a99e2'
AND (
token = 'hdrmQWHogIAIYFpwbUx/RBD8gLvqNwO2v0kwnIHz3U4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)