UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JQ0Gbp3TVGPeRb/PiVnju5RktQDGKdN1hP/1e/DVWGY=' 
WHERE 
  key_id = '8c8370da43b2fac69647aeddefde7881dc20da8a60baacbe339f9417ba26150c' 
  AND (
    token = 'JQ0Gbp3TVGPeRb/PiVnju5RktQDGKdN1hP/1e/DVWGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022