UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RvU4LptM8oz+/m4VCYRNP5kHG63xqMsEuDf3mlDWhn4=' 
WHERE 
  key_id = '4bc439df85164c37b9a51b537feda5cb327bd43160ba3d84204dd27119cd0c1a' 
  AND (
    token = 'RvU4LptM8oz+/m4VCYRNP5kHG63xqMsEuDf3mlDWhn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039