UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zmFGC+/t9obNRDVh0vAwYUm37MA0j6/Jj4xha+HChq8='
WHERE
key_id = 'd31eb31e74c28ce60970cacab6d55134a96c56f9cf6d9d6679a9e757b022d3c5'
AND (
token = 'zmFGC+/t9obNRDVh0vAwYUm37MA0j6/Jj4xha+HChq8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)