UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IN+EVyalM98w3CGRuTXgGeSoGk3c3EKNT35zlyaPTvQ=' 
WHERE 
  key_id = 'aa8d8bff808154b1c86f6fd12e31cd53de52b67c7f3011aacacc02cd90640fe4' 
  AND (
    token = 'IN+EVyalM98w3CGRuTXgGeSoGk3c3EKNT35zlyaPTvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041