UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yw+wfOR0A5w7PxCwSqBj/OhVLurITxz19J/zF5NIV4c=' 
WHERE 
  key_id = '30422f8c47bcab1be83da3192f7dd7027af9ec9280c74c2d1a1a14924af1dd68' 
  AND (
    token = 'yw+wfOR0A5w7PxCwSqBj/OhVLurITxz19J/zF5NIV4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026