UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLC7yWasUFtzuOr4uw/wJdtcimSWoBrqIIDyNGXvM8U=' 
WHERE 
  key_id = '19dc79c9450eefe51722b1cf3b94ed784fcecca8349e4039136e84740c4bf0d4' 
  AND (
    token = 'bLC7yWasUFtzuOr4uw/wJdtcimSWoBrqIIDyNGXvM8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034