UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+JOBQEeXK/XbH5XALrycxSg0x3Pg+FDDtzFpiivZuik='
WHERE
key_id = '905f6a7d5a24fab5b0f95f73706c030afeb0fef340fe99fd033a8581446754f3'
AND (
token = '+JOBQEeXK/XbH5XALrycxSg0x3Pg+FDDtzFpiivZuik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)