UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1SY68vwEgTWcclhJ/uV/GmonsLLXRb7umQ8og1C//eM=' 
WHERE 
  key_id = '5a7ee7936dea0392023dcd44932b5ffd2c489576deff8930f6b09694d174cbf9' 
  AND (
    token = '1SY68vwEgTWcclhJ/uV/GmonsLLXRb7umQ8og1C//eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021