UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XWrzSQ8TzTsPdJ3j8aSEM3Onx2tmNj+QODoV3Aj7/r4=' 
WHERE 
  key_id = 'bedc48bbb6b6fdcc64636e59687a1c7a2dcf5d7cbea95538f22997a5f27b2449' 
  AND (
    token = 'XWrzSQ8TzTsPdJ3j8aSEM3Onx2tmNj+QODoV3Aj7/r4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025