UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+cSMIQJyuq/FRUeZO40MLpEjyzEM6c8sPCw3O6noOSo='
WHERE
key_id = '2af0fd1705fdf6fe4ec8f9c92441a44097de4fd6e1a4052db8620ad9cb5b6307'
AND (
token = '+cSMIQJyuq/FRUeZO40MLpEjyzEM6c8sPCw3O6noOSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)