UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aoj/wk7LOJ3fe/rF4GD7MSDo8zusDpg4idnEmvzs4yw='
WHERE
key_id = 'eeb654610d3efad78092e0e3203a59f93881a87d839346dc7e217ec4d898d9b4'
AND (
token = 'Aoj/wk7LOJ3fe/rF4GD7MSDo8zusDpg4idnEmvzs4yw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)