UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9di9oOEIgQXfT0SlrIr/Lg9hd3e4YiXQh+wyv8dFCoo=' 
WHERE 
  key_id = 'ec0d5adde4a9ab3744dd7925f5048e0f0bbf125837d17f8ee2c3521b927ed17f' 
  AND (
    token = '9di9oOEIgQXfT0SlrIr/Lg9hd3e4YiXQh+wyv8dFCoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021