UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fqerdGf55QDPXbQo3s9QCqwEKg7+ScfSNCdOgIWBhSE=' 
WHERE 
  key_id = '274b557491369a0858a2dc071f205f0cfc0b5f71015ad7c5958748736827316c' 
  AND (
    token = 'fqerdGf55QDPXbQo3s9QCqwEKg7+ScfSNCdOgIWBhSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031