UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2g6N+BR6rYxgEcQpuFY8FDZJSE7BTHT0/bPJYGp7XCw='
WHERE
key_id = '7c92dc3f20dd6d0aa734e24557ef023fa60f53489218b9467ea30059a6075a77'
AND (
token = '2g6N+BR6rYxgEcQpuFY8FDZJSE7BTHT0/bPJYGp7XCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)