UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FwHctYQwiYuF6kfUoPRLcdpqhmGgyH8nf7xdP5YkOxo='
WHERE
key_id = '8862fa9de56058da6ad2fa285dfce699c9b99bb011275a19ca61b63defeb0cd8'
AND (
token = 'FwHctYQwiYuF6kfUoPRLcdpqhmGgyH8nf7xdP5YkOxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)