UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5UQS2nBiiIsCABz1O5Q1+zCuM+WaMfgdUIhH7As5sy4=' 
WHERE 
  key_id = '1b791eedca2d030d4649bfc9df7adc6cd3122ee025ab8006bae0f80b81b86449' 
  AND (
    token = '5UQS2nBiiIsCABz1O5Q1+zCuM+WaMfgdUIhH7As5sy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041