UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hKyBq6s3+6uGlj3xFOGVbjdhfdxQc6OmRPn/bXOVK50=' 
WHERE 
  key_id = 'dd3d4763cb99c926a789ee2f8d1ca5fe9e9beb2b7b323a01d706aed6f604e1a4' 
  AND (
    token = 'hKyBq6s3+6uGlj3xFOGVbjdhfdxQc6OmRPn/bXOVK50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026