UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QRc8IcvwIn+eBV+IrXxo+Ms/SupOAwlF93BCcDGRoGQ='
WHERE
key_id = 'a3eb6b068600768a08e21cb5ce0d8ff1346de446de7e1be8edd0186bfb629bc3'
AND (
token = 'QRc8IcvwIn+eBV+IrXxo+Ms/SupOAwlF93BCcDGRoGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)