UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOEaoJA4B2hBrSxBz/VSQeqPd3GZ/tZ89o+6c7Rq3mE='
WHERE
key_id = 'c0b6c29ceae3d112a81c8ce425d975b7cee66ba62cffb138f988fc1984b0a77e'
AND (
token = 'YOEaoJA4B2hBrSxBz/VSQeqPd3GZ/tZ89o+6c7Rq3mE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)