UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bl5lA913ABl7bi7rmMFLbTJLBV0lpJ4VkcMxh0MQmE='
WHERE
key_id = '22ddbefccd7bdb0971a0ee537254c3d3f6bfb45d0dcc854fc87f77f43256ca80'
AND (
token = '1bl5lA913ABl7bi7rmMFLbTJLBV0lpJ4VkcMxh0MQmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)