UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TgKRanvnDZEIDZIr4PbmY05G6hKuOdBFbPWFfJsaSeM=' 
WHERE 
  key_id = '8df629d1c44104668ce8cd9b2d18b6d664ac3f4fc607009d6f7e22ec9a2d5c83' 
  AND (
    token = 'TgKRanvnDZEIDZIr4PbmY05G6hKuOdBFbPWFfJsaSeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061