UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c6Z8Ks5SgdKdK8XWFsjgi1NYOqMo/iw5TgsgPpPdlpU=' 
WHERE 
  key_id = '64c41c8d20db2be77cf37b44227e0143c78f0ed1ac4a4a6f65fa5a4a958f3179' 
  AND (
    token = 'c6Z8Ks5SgdKdK8XWFsjgi1NYOqMo/iw5TgsgPpPdlpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042