UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MvGJVtBwNeZN69eBiwOJbJHmxEXUHO7CKm1Umz9FRr8='
WHERE
key_id = 'deb5ea7a663d048650fb58b5570101f4f2c57ea987506f62820fa173d0692b77'
AND (
token = 'MvGJVtBwNeZN69eBiwOJbJHmxEXUHO7CKm1Umz9FRr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)