UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DeQ/NiMPBV+nvvCDkpOPrDnVVlKU9gxHopEgVVzToeI='
WHERE
key_id = 'c7fb8576025a37b0d9eebc5af0f9af139b46fcb6072e8bd655d56b4c72c80715'
AND (
token = 'DeQ/NiMPBV+nvvCDkpOPrDnVVlKU9gxHopEgVVzToeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)